package com.zwr.sheller.shop.mapper;

import com.zwr.sheller.core.pojo.Goods;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

/**
 * @author ljc
 * @date 2022/1/7
 **/
public interface GoodsMapper extends Mapper<Goods> {

    List<Map<String, Object>> selectClassification(String nameOrKeyWord);

    List<String> getParentClassification(Long storeId);

    void addClassification(Long sort, Long parentClassification, String name, String keyWord, String imgPath, Boolean isRelevance, Boolean isDisplay, Boolean isRecommend, String desc, Long storeId, Integer rank);

    Map<String, Object> selectParentIdAndRankByName(String name, Long storeId);

    Boolean deleteGoodsClassification(Long classificationId, Long storeId);

    List<Map<String, Object>> selectParentIdIsExist(Long classificationId);

    List<Map<String, Object>> selectClassificationName(Long storeId, Integer rank);

    Long selectLabelGroupIdByLabelGroupName(String name);

    List<Map<String, Object>> selectGoodsNoPage1(Long itemId, String goodsNameOrKeyWord, Integer rank, String goodsLabel, Long storeId);

    List<Map<String, Object>> selectGoodsNoPage2(Long itemId, String goodsNameOrKeyWord, Integer rank, String goodsLabel, Long storeId);

    Integer deleteGoods(@Param("goodsIdList") List<String> goodsIdList);

    Integer upOrDownShelfGoods(@Param("goodsIdList") List<String> goodsIdList, String way, Timestamp shelfTime);

    Integer recoverGoods(@Param("goodsIdList") List<String> goodsIdList);

    Integer updateGoodsClassification(@Param("goodsIdList") List<String> goodsIdList, Long firstItemId, Long secondItemId, Long thirdItemId);

    Integer updateGoodsLabel(@Param("goodsIdList") List<String> goodsIdList, String label1, String label2, String label3, Long labelGroupId);

    Integer activateOrDisabledLabelGroup(@Param("goodsIdList") List<String> labelGroupList, Boolean way);

    Integer updateGoodsLabelGroupId(String labelGroupId);
}
